import Ember from 'ember';
import RSVP from 'rsvp';
import config from 'game-front/config/environment';

export default Ember.Route.extend({
  actions:{
    tabble(){
      $("#imgFrist").attr("src","assets/images/ranking/dt2.png");
      $("#cont-test").css({"display":"none"});
      $("#cont-text").css({"display":"block"});
    },
    tabbles(){
      $("#imgFrist").attr("src","assets/images/ranking/dt.png");
      $("#cont-test").css({"display":"block"});
      $("#cont-text").css({"display":"none"});
    }
  },model() {
    var userInfo = this.modelFor("application");
    return RSVP.hash({
      userInfo: userInfo,
      joinedRankings: $.getJSON(config.apiBase + "rankingHistories/joined", {userId:userInfo.userId, page:0, size:20}),
      wonRankings: $.getJSON(config.apiBase + "rankingHistories/won", {userId:userInfo.userId, page:0, size:20})
    });
  }
});
